CC=g++
CCC=gcc

CFLAGS=-Iinc -I/usr/include/GL -I/usr/include/libdrm -g -c -Wall

#CFLAGS=-Iinc -I/usr/include/GL -I/usr/include/libdrm -c -Wall
LDFLAGS=-lGLESv2 -lGL -lEGL -lX11 -lXext -Iinc
SOURCES=src/boot_linux.cpp \
		src/test_linux.cpp \
		src/game.cpp \
		src/program.cpp \
		src/program_manager.cpp \
		src/shader.cpp \
		src/singleton.cpp \
		src/texture.cpp
OBJECTS=$(SOURCES:.cpp=.o)

SOURCES_C=src/targa.c
OBJECTS_C=$(SOURCES_C:.c=.o)
EXECUTABLE=corsario

all: $(SOURCES) $(EXECUTABLE)
    
$(EXECUTABLE): $(OBJECTS_C) $(OBJECTS) 
	$(CC)  $(OBJECTS_C) $(OBJECTS) $(LDFLAGS) -o $@
	cp $(EXECUTABLE) ./bin/$(EXECUTABLE)
	
.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

.c.o:
	$(CCC) $(CFLAGS) $< -o $@

clean:
	rm -fr $(EXECUTABLE)
	rm -fr src/*.o

